﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ImageAcquisitionTAL.Properties;

namespace ImageAcquisitionTAL
{
    public static class ImageAcquisitionTechnologyFactory
    {
        public static IAcquisitionTechnology SelectSupportedTechnology()
        {
            if (Settings.Default.UseDummyTechnology)
                return new NoTechnology();
            else
            {                    
                IAcquisitionTechnology tech;
                tech = new WIA20Technology();
                if (tech.IsAvailable())
                    return tech;
                tech = new WIA10Technology();
                if (tech.IsAvailable())
                    return tech;
                tech = new TWAINTechnology();
                if (tech.IsAvailable())
                    return tech;                
            }
            return new NoTechnology();
        }
    }
}
